﻿using MTQ.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MTQ.BLL
{
    public partial class Base_LocalUserService : BaseService<Base_LocalUser>
    {
        public void SetUser(Guid userid, string language)
        {

            Base_LocalUser localuser = this.LoadEntities(x => x.User_Id == userid).FirstOrDefault();

            if (localuser == null)
            {
                localuser = new Base_LocalUser() { User_Id = userid, LanguageName = language, LU_ID = System.Guid.NewGuid() };
                this.AddEntity(localuser);
            }
            else
            {
                localuser.LanguageName = language;
                this.UpdateEntity(localuser);
            }

        }


    }
}
